package com.blue.seata.storage.api.remote;

import com.blue.seata.common.JsonResult;
import com.blue.seata.storage.api.fallback.RemoteStorageServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 库存feign接口
 *
 * @author liulei
 * @version 1.0
 */
@FeignClient(name = "storage", path = "storage", fallbackFactory = RemoteStorageServiceFallbackFactory.class)
public interface RemoteStorageService {

    /**
     * 创建库存信息
     *
     * @param code  商品code
     * @param count 个数
     * @return json
     */
    @RequestMapping(value = "/test/minus", method = RequestMethod.GET)
    JsonResult minus(@RequestParam String code, @RequestParam Integer count);
}
